/**
 * PlyFileParser.h
 *
 * Author:
 *   Chris Herbison
 *
 * Description:
 *   Utility class that will return a list of 4 element vectors containing 3 points of a triangle and its normal vector.
 */

#ifndef PLYFILEPARSER_H
#define PLYFILEPARSER_H

#include <iostream>
#include <vector>
#include "vecmath.h"

using namespace std;

class PlyFileParser{
public:
	PlyFileParser();
	PlyFileParser(string _filename);

	/* Parses a given file and returns the triangle/normal data.
	 * 
	 * file - The filename to read.
	 *
	 * return - A vector of 4 element vectors containing the verticies of a triangle and its normal in the format {p1, p2, p3, n}
	 *
	 * Preconditions:
	 *    The file is assumed to exist.
	 *    The file is assumed to be in ascii 1.0 ply format.
	 *    The vertex element must be the first listed element.
	 *    The file is assumed to have x, y, and z verticies listed in floats and vertex indicies in integer format (any other properties will be ignored).
	 *    The x, y, and z properties must be the first 3 listed after the vertex element.
	 *    The faces must always be listed as triangles (3 verticies).
	 *    Elements other than verticies and faces will be ignored.
	 */
	vector<vector<Point3> > parseFile();
	vector<vector<Point3> > parseFile(string file);
	vector<vector<Point3> > parseFileRectColor();
	vector<vector<Point3> > parseFileRectColor(string file);

private:
	string filename;
};

#endif